<?
  include_once "config/WXBizMsgCrypt.php";

  $encodingAesKey = "Y1jHCiJozGmW3D2MwbuzEpA20zSMBYP7e4d2uxgU2dl";
  $token = "qRDz8di";
  $corpId = "wx738487f50daf3291";

  $sVerifyTimeStamp = $_GET["timestamp"];
  $sVerifyNonce = $_GET["nonce"];
  $sVerifyEchoStr = $_GET["echostr"];

  $EchoStr = "";

  $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);
  $errCode = $wxcpt->VerifyURL($sVerifyMsgSig, $sVerifyTimeStamp, $sVerifyNonce, $sVerifyEchoStr, $sEchoStr);
  if ($errCode == 0) {
  	//
  	// 验证URL成功，将sEchoStr返回
  	echo $sEchoStr;
  } else {
  	print("ERR: " . $errCode . "\n\n");
  }
?>
